home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 205_01 / words.c < prev    next >
Text File  |  1980-01-01  |  896b  |  36 lines

  1. /*
  2. HEADER:                 CUG205.00;
  3. TITLE:                  WORDS for Microsoft;
  4. DATE:                   09/24/86;
  5. DESCRIPTION:
  6.   "Places words on individual lines.";
  7. KEYWORDS:               Software tools, Text filters, words, make words;
  8. SYSTEM:                 MS-DOS;
  9. FILENAME:               WORDS.C;
  10. WARNINGS:
  11.   "The author claims copyrights and authorizes non-commercial use only.";
  12. AUTHORS:                 Michael M. Yokoyama;
  13. COMPILERS:              Microsoft;
  14. */
  15.  
  16. #include <stdio.h>
  17. #include <ctype.h>
  18.  
  19. main()
  20. {
  21.   int ch;
  22.   int col;
  23.   col = 1;
  24.  
  25.   while ((ch = getchar()) != EOF) 
  26.     if (isalpha(ch)) {
  27.       putchar(ch); 
  28.       col ++;
  29.     }
  30.     else
  31.       if (col != 1) {
  32.         putchar('\n'); 
  33.         col = 1;
  34.       }
  35. }
  36.